From: Abderrahim Kitouni Date: Sat, 16 Jan 2021 17:45:07 +0000 (+0100) Subject: dash: Fix 'All apps' button position in RTL locales X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~584 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0a2372136437b093b59a5ce120c38a80c8d7a83f;p=gnome-shell.git dash: Fix 'All apps' button position in RTL locales Part-of: --- diff --git a/js/ui/dash.js b/js/ui/dash.js index a4dc7a8fb..3d6e75623 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -295,16 +295,27 @@ class DashActor extends St.Widget { let [appIcons, showAppsButton] = this.get_children(); const [, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight); + const rtl = this.text_direction === Clutter.TextDirection.RTL; let childBox = new Clutter.ActorBox(); - childBox.x1 = contentBox.x1; childBox.y1 = contentBox.y1; - childBox.x2 = contentBox.x2 - showAppsNatWidth; childBox.y2 = contentBox.y2; + if (rtl) { + childBox.x1 = contentBox.x1 + showAppsNatWidth; + childBox.x2 = contentBox.x2; + } else { + childBox.x1 = contentBox.x1; + childBox.x2 = contentBox.x2 - showAppsNatWidth; + } appIcons.allocate(childBox); - childBox.x1 = contentBox.x2 - showAppsNatWidth; - childBox.x2 = contentBox.x2; + if (rtl) { + childBox.x1 = contentBox.x1; + childBox.x2 = contentBox.x1 + showAppsNatWidth; + } else { + childBox.x1 = contentBox.x2 - showAppsNatWidth; + childBox.x2 = contentBox.x2; + } showAppsButton.allocate(childBox); }